{% extends "admin/change_list.html" %}

{% comment %}
# change_list.html
# Author: Nico Marrero
# Copyright 2012 Nico Marrero
#
#	 This file is part of django-serenity.
#
#    django-serenity is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    django-serenity is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with django-serenity.  If not, see <http://www.gnu.org/licenses/>.
{% endcomment %}


{% block extrahead %}
	<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js" type="text/javascript"></script>
	{{block.super}}
	<script type="text/javascript">
	$(document).ready(function(){
		$(".expansion_expand").click(function(event)
        {
			event.preventDefault();
			$(this).siblings(".expansion_teaser").hide();
            $(this).siblings(".expansion_content").slideDown();
            $(this).siblings(".expansion_collapse").slideDown();
            $(this).hide();
        });
		$(".expansion_collapse").click(function(event)
        {
			event.preventDefault();
			$(this).siblings(".expansion_teaser").show();
            $(this).siblings(".expansion_content").slideUp();
            $(this).siblings(".expansion_expand").show();
            $(this).hide();
        });
		$(".expansion_toggle").click(function(event)
        {
			event.preventDefault();
			$(this).siblings(".expansion_content").toggle();
			$(this).siblings(".expansion_teaser").toggle();
			$(this).siblings(".expansion_expand").toggle();
			$(this).siblings(".expansion_collapse").toggle();
			
        });
		$(".expansion_collapse").hide();
		$(".expansion_content:not(.expansion_open)").hide();
	});
	</script>
{% endblock extrahead %}

{% block content %}
	{{block.super}}
	<hr>
	{% for log in AdventureLogs %}
		<br>
		<span class="expansion_container">
			<span class="expansion_toggle">
				<h3><a href="">{{log.title}}</a></h3>
				<p>{{log.date}}</p>
			</span>
			<span class="expansion_teaser">
			{{log.initial_text}}
			</span>
			<span class="expansion_expand">
				... <a href="">[Read More]</a>
			</span>
			<span class="expansion_content">
				{{log.entry|safe}}
			</span>
			<span class="expansion_collapse">
				<br><a href="">[Collapse]</a>
			</span>
		</span>
	{% endfor %}	
{% endblock content %}